import time

import webview


def hide_show(window):
    print('窗口启动时已隐藏')

    time.sleep(5)
    print('显示窗口')
    window.show()

    time.sleep(5)
    print('隐藏窗口')
    window.hide()

    time.sleep(5)
    print('再次显示')
    window.show()


if __name__ == '__main__':
    window = webview.create_window(
        '隐藏/显示窗口', 'https://pywebview.idepy.com/hello', hidden=True
    )
    webview.start(hide_show, window)
